package com.skypan.booklistmainactivity.data;

import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Picture;
import android.widget.ImageView;

import com.skypan.booklistmainactivity.R;

public class Hamster {
    private float x, y;
    private Bitmap myBitmap;

    public Hamster(float x, float y, Bitmap myBitmap) {
        this.x = x;
        this.y = y;
        this.myBitmap = myBitmap;
    }

    public void draw(Canvas canvas){
        Paint paint = new Paint();
        canvas.drawBitmap(myBitmap, x, y, paint);
    }

    public boolean isShot(float touchedX, float touchedY) {
        float new_x = x + 100;
        float new_y = y + 100;
        double distance=(touchedX-new_x)*(touchedX-new_x)+(touchedY-new_y)*(touchedY-new_y);
        return distance<100*100;
    }
}
